Skip to content

Use Hint Bridge for Constraining HintLoad#39

Merged
kunxian-xia merged 18 commits intofeat/v1.4.1-scroll-extfrom
feat/hint_bridge
Mar 16, 2026
Merged

Use Hint Bridge for Constraining HintLoad#39
kunxian-xia merged 18 commits intofeat/v1.4.1-scroll-extfrom
feat/hint_bridge

Conversation

@darth-cy
Copy link

@darth-cy darth-cy commented Mar 9, 2026

  • Add a LookupBus encapsulation to constrain the values loaded from hint_space.
  • Change NativeSumcheck to use hint space loading by default. Make opcode's writeback operation optional to reduce cycles.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new “hint bus/bridge” mechanism to constrain values read from hint_space, and updates Native sumcheck to source inputs from hint space by default with optional witness-array writeback.

Changes:

  • Add HintBus/HintBridge to the system port and plumb it through circuit extensions.
  • Update NativeSumcheck to always read prod/logup inputs from hint_space, make writeback optional, and add hint-bus lookups for those reads.
  • Introduce a HintSpaceProvider AIR/chip intended to provide hint keys for the lookup table.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
extensions/sha256/circuit/src/sha256_chip/air.rs Ignore new hint_bridge system port field.
extensions/rv32im/circuit/src/extension/mod.rs Ignore new hint_bridge system port field in RV32 extensions.
extensions/native/circuit/src/sumcheck/execution.rs Sumcheck executor now reads prod/logup evals from hint_space and gates writeback.
extensions/native/circuit/src/sumcheck/columns.rs Replace is_hint_src_id with is_writeback + hint-id columns.
extensions/native/circuit/src/sumcheck/chip.rs Tracegen updated for hint-space inputs, optional writeback, and hint-provider requests.
extensions/native/circuit/src/sumcheck/air.rs Sumcheck AIR adds HintBridge lookups and optional writeback behavior.
extensions/native/circuit/src/poseidon2/air.rs Plumb HintBridge into Native Poseidon2 AIR constructor/state.
extensions/native/circuit/src/lib.rs Export new hint_space_provider module.
extensions/native/circuit/src/hint_space_provider.rs New provider AIR/chip to supply (hint_id, offset, value) keys on the hint bus.
extensions/native/circuit/src/extension/mod.rs Wire hint bridge/provider AIR + chip into Native extension (CPU).
extensions/keccak256/circuit/src/extension/mod.rs Ignore new hint_bridge system port field.
extensions/ecc/circuit/src/extension/weierstrass.rs Ignore new hint_bridge system port field.
extensions/bigint/circuit/src/extension/mod.rs Ignore new hint_bridge system port field.
extensions/algebra/circuit/src/extension/modular.rs Ignore new hint_bridge system port field.
extensions/algebra/circuit/src/extension/fp2.rs Ignore new hint_bridge system port field.
crates/vm/src/system/mod.rs Add HintBus/HintBridge to system config, inventory, and SystemPort.
crates/vm/src/system/memory/offline_checker/columns.rs Add hint read/write aux column structs.
crates/vm/src/system/memory/offline_checker/bus.rs Add HintBus wrapper over LookupBus.
crates/vm/src/system/memory/offline_checker/bridge.rs Add HintBridge wrapper exposing lookup/provide API.
crates/vm/src/arch/testing/mod.rs Reserve HINT_BUS bus index for tests.
crates/vm/src/arch/testing/cuda.rs Add hint_bridge() and include it in SystemPort for GPU tests.
crates/vm/src/arch/testing/cpu.rs Add hint bridge to SystemPort for CPU tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

darth-cy added 8 commits March 9, 2026 17:45
This PR adds CUDA/GPU support for the HintSpaceProvider periphery chip used by the new HintBridge, enabling GPU-side trace generation for the hint space provider table and registering the chip in the GPU prover extension.
let local = main.row_slice(0);
let local: &HintSpaceProviderCols<AB::Var> = (*local).borrow();

builder.assert_bool(local.is_valid);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to make sure that the tuple (hint_id, offset) is monotonically increasing s.t. two different lookups with key (hint_id, offset) will not return different value.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Monotonicity constraints are now available

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 25 out of 26 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@kunxian-xia kunxian-xia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@kunxian-xia kunxian-xia merged commit f2981fe into feat/v1.4.1-scroll-ext Mar 16, 2026
1 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants